#include "apue.h"
#include "error.c"
#include <fcntl.h>

int main(int argc, char const *argv[])
{
    if(argc != 2)
        err_quit("exec param error");

    if(open(argv[1], O_RDWR) < 0){
        err_sys("open file %s error", argv[1]);
    }

    if(unlink(argv[1]) < 0){
        err_sys("unlink error");
    }
    
    printf("file unlinked\n");

    sleep(15);

    printf("done\n");
    return 0;
}
